/*
 * =====================================================================================
 *
 *       Filename:  log_commands.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  26/03/13 11:06:33
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Tsihang (), isoledadcache@gmail.com
 *        COMPANY:  SGCHIP
 *
 * =====================================================================================
 */

#ifndef __CLI_LOG_COMMANDS_H__
#define __CLI_LOG_COMMANDS_H__
#include "../../../Platform/COMMON/cdefs.h"


/* The server logging port where log to */
#ifndef LOG_SERPORT
#define 	LOG_SERPORT			50000
#endif

#ifndef LOG_ENTRY_SIZE
#define LOG_ENTRY_SIZE		512
#endif

#ifndef MAX_LOG_COUNT	
#define MAX_LOG_COUNT		1024
#endif	

#ifndef NUMBER_OF_SYSLOG_SERVER
#define NUMBER_OF_SYSLOG_SERVER	4
#endif

#ifndef MAX_POLICY_LENGTH
#define MAX_POLICY_LENGTH	512
#endif

#define LOG_FILE_LOCATION	"/home/tsihang/Workplace/RPC/RPC-2.0.0c/log_file.log"

/*
  * priorities/facilities are encoded into a single 32-bit quantity, 
where the
  * bottom 3 bits are the priority (0-7) and the top 28 bits are the 
facility
  * (0-big number).  Both the priorities and the facilities map roughly
  * one-to-one to strings in the syslogd(8) source code.  This mapping is
  * included in this file.
  *
  * priorities (these are ordered)
  */

#define SYSLOG_EMERG       	0       /* system is unusable */
#define SYSLOG_ALERT       	1       /* action must be taken immediately */
#define SYSLOG_CRIT        	2       /* critical conditions */
#define SYSLOG_ERR         	3       /* error conditions */
#define SYSLOG_WARNING     	4       /* warning conditions */
#define SYSLOG_NOTICE      	5       /* normal but significant condition */
#define SYSLOG_INFO        	6       /* informational */
#define SYSLOG_DEBUG       	7       /* debug-level messages */

/* facility codes */
#define SYSLOG_KERN        	(0<<3)  /* kernel messages */
#define SYSLOG_USER        	(1<<3)  /* random user-level messages */
#define SYSLOG_MAIL        	(2<<3)  /* mail system */
#define SYSLOG_DAEMON      	(3<<3)  /* system daemons */
#define SYSLOG_AUTH        	(4<<3)  /* security/authorization messages */
#define SYSLOG_SYSLOG      	(5<<3)  /* messages generated internally by syslogd */
#define SYSLOG_LPR         	(6<<3)  /* line printer subsystem */
#define SYSLOG_NEWS        	(7<<3)  /* network news subsystem */
#define SYSLOG_UUCP        	(8<<3)  /* UUCP subsystem */
#define SYSLOG_CRON        	(9<<3)  /* clock daemon */
#define SYSLOG_AUTHPRIV    	(10<<3) /* security/authorization messages (private) */
                                 /* Facility #10 clashes in DEC UNIX, where */
                                 /* it's defined as LOG_MEGASAFE for AdvFS  */
                                 /* event logging */
#define SYSLOG_FTP         	(11<<3) /* ftp daemon */
#define SYSLOG_NTP         	(12<<3) /* NTP subsystem */

/* other codes through 15 reserved for system use */
#define SYSLOG_LOCAL0      (16<<3) /* reserved for local use */
#define SYSLOG_LOCAL1      (17<<3) /* reserved for local use */
#define SYSLOG_LOCAL2      (18<<3) /* reserved for local use */
#define SYSLOG_LOCAL3      (19<<3) /* reserved for local use */
#define SYSLOG_LOCAL4      (20<<3) /* reserved for local use */
#define SYSLOG_LOCAL5      (21<<3) /* reserved for local use */
#define SYSLOG_LOCAL6      (22<<3) /* reserved for local use */
#define SYSLOG_LOCAL7      (23<<3) /* reserved for local use */

#define SYSLOG_DEFAULT_PRIORITY (SYSLOG_LOCAL5+SYSLOG_NOTICE)
#define SYSLOG_EMERG_PRIORITY (SYSLOG_LOCAL5+SYSLOG_EMERG)
#define SYSLOG_ALERT_PRIORITY (SYSLOG_LOCAL5+SYSLOG_ALERT)
#define SYSLOG_CRIT_PRIORITY (SYSLOG_LOCAL5+SYSLOG_CRIT)
#define SYSLOG_INFO_PRIORITY (SYSLOG_LOCAL5+SYSLOG_INFO)

#define SYSLOG_PRIMASK     0x07    /* mask to extract priority part (internal) */



__BEGIN_DECLS

extern	int g_timezone;
extern	void log_cmd_init();

__END_DECLS


#endif


	
